import React from 'react'
import { useEffect } from 'react';
import { addUser, userQuery } from '../service/userService';
import {useAppDispatch } from '../store';
import User from './user';

const App = () => {
  const dispath= useAppDispatch();
  useEffect(() => {
   
  },[])
  return (
    <div>
        <User/>
        <hr />
        <button onClick={()=>dispath(userQuery())}>查询用户</button>
        <button onClick={()=>dispath(addUser({id:1002,name:"test-1002"}))}>添加用户</button>
    </div>
  )
}

export default App;